package tmall.common.dto;

import tmall.common.exception.ReturnCode;

/**
 * 接口公共返回对象
 * @author zhangservlet
 * @date 2020/11/20
 */
public class ResponseResult {

    private Integer status = ReturnCode.SUCCESS;

    private String message;

    private Object data;

    private Long timestamp = System.currentTimeMillis();

    public ResponseResult(){
        this.message = "请求成功";
    }

    public ResponseResult(Object data){
        this.message = "请求成功";
        this.data = data;
    }

    public ResponseResult(String message,Integer status){
        this.message = message;
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    @Override
    public String toString() {
        return "ResponseResult{" +
                "status=" + status +
                ", message='" + message + '\'' +
                ", data=" + data +
                ", timestamp=" + timestamp +
                '}';
    }
}
